package com.example.tellwin.mine.act;

import android.os.Bundle;
import android.widget.TextView;

import com.example.tellwin.MainApplication;
import com.example.tellwin.R;
import com.example.tellwin.base.CpBaseActivty;
import com.example.tellwin.base.DaggerRxComponent;
import com.example.tellwin.mine.contract.FeeDescriptionContract;
import com.example.tellwin.mine.presenter.FeeDescriptionPresenter;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;

public class FeeDescriptionActivity extends CpBaseActivty implements FeeDescriptionContract.View {

    @BindView(R.id.description_content_tv)
    TextView descriptionContentTv;

    @Inject
    FeeDescriptionPresenter mPresenter;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fee_description);
        ButterKnife.bind(this);
        initViews();
        initEvents();
        initDatas();
    }

    @Override
    protected void initViews() {
        DaggerRxComponent.builder()
                .baseAppComponent(MainApplication.getAppComponent())
                .build()
                .inject(this);
        mPresenter.attachView(this);
    }

    @Override
    protected void initEvents() {

    }

    @Override
    protected void initDatas() {
        mPresenter.getBillingInstructions();
        setTitle(R.string.fee_description);
    }

    @Override
    public void billingInstructionsResult(String billingInstructions) {
        descriptionContentTv.setText(billingInstructions);
    }
}
